package com.sdry.common;

/**
 * 通用命名
 * @author chenBin
 * @date 2020-3-2 14:08:37
 * @version 1.0
 */
public enum BaseAPIMessageTypeEnum {
    A001("A001","查询数据为空"),
    A002("A002","操作成功"),
    A003("A003","操作失败"),
    A004("A004","该状态已改变"),
    A005("A005","该异常已禁用"),
    A006("A006","未传送该异常id"),
    A007("A007","请核实该工位该异常的向上汇报层级"),
    ;



    private String code;
    private String name;

    BaseAPIMessageTypeEnum(String code, String name){
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(String code){
        for (BaseAPIMessageTypeEnum value : values()) {
            if(value.code.equals(code)){
                return value.name;
            }
        }
        //没有则返回null；
        return "null";

    }

}
